package com.example.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.model.entity.ApplyEntity;
import com.example.demo.model.param.ApplyParam;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ApplyMapper extends BaseMapper<ApplyEntity> {


    @Select("<script>SELECT u.id,u.name,u.phone,u.email,tc.name as classname,u.createdate FROM t_applyer u\r\n"
            + "left JOIN t_classtype tc ON u.classTypeId = tc.id\r\n"
            + "where 1=1 <when test='param.name!=null and param.name!=\"\"'>and u.name=#{param.name}</when> </script>"
    )
    List<ApplyEntity> selectApplyerList(@Param("param") ApplyParam applyParam);
}
